﻿using Frame;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VideoFileOrganization.BatchRename
{
    public partial class RenameBaseFrm : Form
    {
        public delegate void SenMessageEventHanle(string Msg, LogLevel l);
        public event SenMessageEventHanle sendMessageEvent;

        public delegate void ReviseHandlde(BatchRenameClass.tReviseParam param);

        public event ReviseHandlde ReviseEvnet;//向主窗口发送修改消息

        protected Global m_global;
        public Global global
        {
            set { m_global = value; }
            get { return m_global; }
        }
        protected int index = 0;
        public int Index
        {
            set { index = value; }
            get { return index; }
        }

        protected Image tabImage = null;
        public Image TabImage { get { return tabImage; } }

        private delegate void UpdataUiDelegate();
        private delegate void ExecuteButtonDelegate();

        public RenameBaseFrm()
        {
            InitializeComponent();
        }

        public void OnApplyButton(int index)
        {
            if (this.index != index) return;

            Invoke(new ExecuteButtonDelegate(ExecuteButton));
        }

        protected virtual void ExecuteButton() { }

        protected virtual void IniUi() { }

        public void UpdataUi(int index)
        {
            if (this.index == index)
            {
                Invoke(new UpdataUiDelegate(IniUi));
            }
        }

        public void OnReviseEvnet(BatchRenameClass.tReviseParam param)
        {
            ReviseEvnet(param);
        }
    }
}
